package com.ymatou.iapi.sellertrading.service;

import com.google.gson.Gson;
import com.ymatou.iapi.sellertrading.parameter.GetMasterOrderDetailRequestBean;
import com.ymatou.iapi.sellertrading.response.GetMasterOrderDetailResponseBean;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;

public class GetMasterOrderDetailCall extends YmatouAutoTestCall{
	
	private static String opurl = "/api/orderquery/getMasterOrderDetail";
	
	public GetMasterOrderDetailCall(){
		super(EnvSetup.getSystemUrl("sellertrading_iapi"),opurl,"GET","PARAM");
	}
	
	public void addDefHeader(){
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		GetMasterOrderDetailRequestBean request = new GetMasterOrderDetailRequestBean();
		GetMasterOrderDetailCall call = new GetMasterOrderDetailCall();
		
		request.setMasterOrderId(1858188699);
		request.setSellerId(24635724);
		request.setUserId(24635724);
		
		String json = call.callAndGetReturnData(request).toString();
		
		GetMasterOrderDetailResponseBean response = new Gson().fromJson(json, 
				GetMasterOrderDetailResponseBean.class);
		
		System.out.println(response);
	}
}
